﻿using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;

namespace WebAppDemo
{
    /// <summary>
    /// Summary description for $codebehindclassname$
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    public class HttpOperationMethod : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            string result = string.Empty;


            string method = context.Request.RequestType.ToUpper();
            switch (method)
            {
                case "POST":
                    result = "this is post method!";
                    break;
                case "GET":
                    result = "this is get method!";
                    break;
                case "DELETE":
                    result = "this is get method!";
                    break;
                case"PUT":
                    result = "this is put method!";
                    break;
                default:
                    result = "this is not valid parameter!";
					
                    break;
            }
            context.Response.Write(result);
			
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}
